package com.zzyl.mapper;

import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationVo;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CustomerReservationMapper {


    Integer getCancelCount(Long updateBy);

    void insert(Reservation reservation);

    List<ReservationVo> pageList(Integer status);

    @Update("update reservation set status = 2 where id = #{id}")
    void cancel(Long id);

    List<TimeCountVo> countByTime(String time);

    @Update("update reservation set status = 3 where status = 0 and time < #{formattedTime}")
    void changeOverTime(String formattedTime);
}
